package bean;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.BeanFactoryAware;

import java.util.Date;

/**
 * @author DJJ_F
 * @version 1.0
 * @date 2024/11/28
 * @description
 */
public class Person implements BeanFactoryAware {
    private String name;

    private Date birthDay;

    public Person() {
        System.out.println("Person的无参构造方法执行了");
    }

    public Person(String name) {
        this.name = name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setBirthDay(Date birthDay) {
        this.birthDay = birthDay;
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", birthDay=" + birthDay +
                '}';
    }

    @Override
    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
        System.out.println("工厂：" + beanFactory);
    }
}
